﻿create procedure [dbo].[usp_WorkItemUpdate]
	@WorkItemId int
	, @ConcurrencyId rowversion
	, @Id int
	, @TeamFoundationServerId int
	, @Uri nvarchar(1024)
as

begin try
	
	begin transaction
	
		update [dbo].[WorkItem]
		set
			[Id] = @Id
			, [TeamFoundationServerId] = @TeamFoundationServerId
			, [Uri] = @Uri
		where WorkItemId = @WorkItemId and ConcurrencyId = @ConcurrencyId
		
	commit transaction

end try
	
begin catch
	if @@trancount > 0
	begin
		rollback transaction;
	end
	execute [dbo].[usp_SqlErrorInsert]
end catch


